<ion-view title="{{title}}"  >
  <ion-nav-buttons side="right">
    <button ng-hide="authority==3||task_groupid!=1&&task_groupid!=2"
            class="button button-icon icon ion-more"
            ns-popover
            ns-popover-template="moreMenu"
            ns-popover-trigger="click"
            ns-popover-theme="ns-popover-list-theme"
            ns-popover-placement="bottom|right"
            ns-popover-timeout="2"></button>
  </ion-nav-buttons>
  <ion-content class="has-header">
    <div class="list">
    	
      <label class="item item-input">
        <input id="taskTitle" type="text" placeholder="输入任务名称"  ng-model="task_title" ng-readonly="authority==3||task_groupid!=1" >
       </label>
              
      <a class="item item-icon-left item-icon-right" ng-click="deadline()"   >
        <i class="icon ion-clock"></i> {{done_date | date:"MM月dd日"}} <i class="icon"><img ion-stop-event width=36 height=36 ng-click="priority($event);" ng-src='img/priority_level_{{priority_level}}_light.png' 
            ns-popover
            ns-popover-template="priorityMenu"
            ns-popover-trigger="click"
            ns-popover-theme="ns-popover-list-theme"
            ns-popover-placement="bottom|right"
            ns-popover-timeout="2"
            ng-hide="authority==3||task_groupid!=1"/></i>
      </a>
    </div>
    <textarea id="taskDetail"  placeholder="这里可以输入详细内容" rows="10" ng-show="mode=='text'" ng-model="task_detail" ng-readonly="authority==3||task_groupid!=1"></textarea>
   
   <div ng-hide="recordPath==''" class="item ion-android-microphone" ng-click="openRecord()">
   	&nbsp;&nbsp;&nbsp;&nbsp;打开录音
   </div>
   
     <div class="list">
      <div class="item" ng-repeat="img in images_list">
       <img src="{{img}}" width="100%">
      </div>
    </div> 
    

  </ion-content>
  <ion-footer-bar>
    <div class="button-bar">
      <a class="button button-assertive"  ng-click="saveOneTodo()" ng-hide="authority==3||task_groupid!=1&&task_groupid!=2" style="font-size:18px;font-weight:bold;"><b>保存</b></a>
     
    </div>
  </ion-footer-bar> 
  
</ion-view>
<script type="text/ng-template" id="moreMenu">
  <div class="triangle"></div>
  <div class="ns-popover-tooltip" style="width:120px;">
    <div class="list" style="margin-top:0;margin-bottom:0;">
      <!--只有待确认时，才弹出添加附件-->
      <a class="item" ng-show="task_groupid==1" ng-click="addAttachment()"> 添加附件 </a>
      <!--只有待确认和已确认时，才弹出更改状态-->
      <a class="item" ng-show="authority==1&&(task_groupid==1||task_groupid==2)" ng-click="changeStatus()"> 更改状态 </a>
    </div>
    
  </div>
</script>
<script type="text/ng-template" id="priorityMenu">
  <div class="triangle"></div>
  <div class="ns-popover-tooltip" style="width:120px;">
    <div class="list" style="margin-top:0;margin-bottom:0;">
      <a class="item item-icon-left" ng-click="setPriority(3)"> <i class="icon"><img width=36 height=36 src='img/priority_level_3_light.png'/></i> 高 </a>
      <a class="item item-icon-left" ng-click="setPriority(2)"> <i class="icon"><img width=36 height=36 src='img/priority_level_2_light.png'/></i> 中 </a>
      <a class="item item-icon-left" ng-click="setPriority(1)"> <i class="icon"><img width=36 height=36 src='img/priority_level_1_light.png'/></i> 低 </a>
      <a class="item item-icon-left" ng-click="setPriority(0)"> <i class="icon"><img width=36 height=36 src='img/priority_level_0_light.png'/></i> 无 </a>
    </div>
  </div>
</script>
